<%inherit file="base.html"/>

<%def name="head()">
    <script>
        function deleteCmanager(cmanager_id){
            if (window.confirm("确定要删除吗？")){
                window.location.href = "/cmanager/delete?manager_id="+cmanager_id;
            }
        }
    </script>
</%def>
<%def name="body()">
<section class="content">
    <div class="box">
    <div class="panel-heading"><i class="fa  fa-user"></i> 客户经理列表</div>
    <div class="panel-body">
        <div class="pull-right bottom10">
             % if permit.match('/cmanager/add'):
            <a href="/cmanager/add" class="btn btn-sm btn-default">
                <span class="glyphicon glyphicon-plus"></span> 增加客户经理
            </a>
            % endif
        </div>
        <table class="table table-hover">
            <thead>
            <tr>
                <th>工号</th>
                <th>姓名</th>
                <th>手机</th>
                <th>关联操作员</th>
            </tr>
            </thead>
            <tbody>
            % for cmanager in page_data.result:
            <tr>
                <td>${cmanager.manager_code}</td>
                <td>
                <a href="/cmanager/detail?manager_id=${cmanager.id}">${cmanager.manager_name}</a>
                </td>
                <td>${cmanager.manager_mobile}</td>
                <td>${cmanager.operator_name}</td>
                <th>
                % if permit.match('/cmanager/update'):
                <a type="button" class=" opt-btn btn-default" href="/cmanager/update?manager_id=${cmanager.id}">修改</a>
                % endif
                % if permit.match('/cmanager/delete'):
                <a type="button" class=" opt-btn btn-default" href="javascript:deleteCmanager('${cmanager.id}')">删除</a>
                </th>
                % endif
            </tr>
            % endfor
            </tbody>
        </table>

        ${page_data.render()}
    </div>
</div>
    </section>
</%def>